home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
escalant
/
escala21.lha
/
escalante2.1
/
bin
/
GenericEd.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-07-14
|
25KB
|
1,106 lines
#include "<PNAME>.h"
#include "EscalanteCommands.h"
//
//Language specific stuff
//
#include "All<PNAME>.h"
#include "<PNAME>Ids.h"
//
//You need this somewhere if you are using GridElements
//This is not normally compiled in the lib
//#include "GridElement.C"
//
//
//Toolkit stuff
//
#include "ObjList.h"
#include "Buttons.h"
#include "OneOfCluster.h"
#include "Env.h"
#include "Box.h"
#include "Menu.h"
#include "MenuBar.h"
//Set these to true if you want to setup the timer or the grid
bool gDoTimer = FALSE;
bool gDoGrid = FALSE;
//
//An Example of the timer ticking thru its elements
//
void <PNAME>Timer::Tick(){
// VGraphElement * obj;
// Iter next(elements);
// while(obj =(VGraphElement*) next()) {
// obj->Tick(); //Or some other method call
//}
}
<PNAME>Timer* g<PNAME>Timer=0;
//
//Here we have a global pointer to a grid defined. If needed.
//
#include "ObjectGrid.h"
ObjectGrid * gGrid=0;
ObjectGrid* <PNAME>View::GetGrid(){
if(gDoGrid) return gGrid;
else return <PNAME>View_BASE::GetGrid();
}
//
//Then if you have classes defined that should be put into the grid
//then overwrite the GetGrid nethod to returnthe gGrid;
//
//ObjectGrid * SomeClass::GetGrid(){return gGrid;}
//
//
//Likewise if you want en element to be registered with a timer then do:
//TimerObject* SomeClass::GetTimer(){return g<PNAME>Timer;}
//
//
//Toolkit macros for setting up the meta Class stuff
//
NewMetaImpl(<PNAME>,<PNAME>_BASE,(0))
NewMetaImpl(<PNAME>View,<PNAME>View_BASE,(0))
NewMetaImpl(<PNAME>Manager,<PNAME>Manager_BASE,(0))
NewMetaImpl(<PNAME>Document,<PNAME>Document_BASE,(0))
//
//Gfx ids - Need to have any gfx id's declared here. Though if you ran Make Everything
//in the spec editor the script, processIds, was run and should have pulled out any
//ids defined and put them in <PNAME>Ids.h
//
int c<PNAME>LabelId = 10000;
//
//There are two attributes of the base view, drawfunc and pickfunc, that
//can be set to a procedure such as the one below. This procedure determines
//whether an element can be drawn (in the case of drawfunc) or
//picked (in the case of pickfunc).
//
//bool <PNAME>Filter(VGraphElement * elt){
//e.g.
//if(elt)
// return (elt->IsKindOf(<PNAME>Node));
//return TRUE;
//}
//
//
//This gets called when the palette list is being created.
//You can put your own tools into the palette, e.g. a delete button.
//Any VObject can be put in here
//The base View grabs the event and calls SetAction(vop id , (void*)vop)
//The example code creates a button marked "delete" and inserts it
//at the front of the list
//
//void <PNAME>View::AddToToolList(ObjList *l){
//
//e.g.:
//ActionButton * vop = new ActionButton(DELETE_ELEMENT,"Delete");
//l->AddBeforePtr(vop,l->First());
//}
//
//
//These methods get called when the view is looking for a tail or head
//for the VRelation nr. If FALSE then the element e is not suitable
//to be picked. If TRUE then it is ok to pick (of course another element
//may be found that is closer.)
//
//bool <PNAME>View::NewTailOk(VRelation* nr,VGraphElement *e){
//return <PNAME>View_BASE::NewTailOk(nr,e);
//}
//
//bool <PNAME>View::NewHeadOk(VRelation* nr,VGraphElement *e){
//return <PNAME>View_BASE::NewHeadOk(nr,e);
//}
//
//
//This gets called when the attribute action is set to something.
//You can return the name of the action. This gets displayed in the Mode: field
//in the view
//
//char * <PNAME>View::ActionName(Actions action){
//switch(action){
//case <PNAME>Action1:return " Name of <PNAME>Action1" ;
//case <PNAME>Action2:return " Name of <PNAME>Action2" ;
//}
//return <PNAME>View_BASE::ActionName(action);
//};
//
//
// ***IMPORTANT****
//
//This method gets called when there has been menu or button input
//It allow you to set the current mode variable, action, define how to pick
//the object you might be looking for with SetNeed(...). Or just do something here
// that doesn't require further input, e.g. hide a bunch of things, etc.
//
bool <PNAME>View::SetAction2(Actions a,void * data){
switch(a){
case <PNAME>StepTimer:
if(g<PNAME>Timer) g<PNAME>Timer->Tick();
break;
case <PNAME>ToggleTimer:
if(g<PNAME>Timer) g<PNAME>Timer->SetActive(!g<PNAME>Timer->active);
break;
//
//This file is generated by the spec editor based on menu actions defined
//in the Define Menu View.
//
#include "<PNAME>ActionSetAction2.h"
//
//This is a file that is generated by the spec editor and contains a bunch
//of hide element actions. It might be good to insert it into this file and
//tailor it to your needs.
//
#include "<PNAME>HSSetAction2.h"
//
//Here is how you can hide Gfx's with a particular ID, e.g. c<PNAME>LabelId, for all
//elements currently shown.
//
//case <PNAME>HideLabels:
//Signature:
// void VGraphElement::SetGfxVisibility(
// int gfxid,
// bool onOrOff,
// bool doWePropagate = FALSE,
// bool prototypeListToo = FALSE,
// Object * view);
//
//
// vgraph->SetGfxVisibility(c<PNAME>LabelId,FALSE, TRUE,TRUE,this);
// break;
//
//
//If a particular action needs some element then set the variable, action, to the appropriate
//action. The SetNeed method allows for the specification of what is needed. One can specify that
//an element,entity or relation is needed possibly of a particular class. Or one can give a function
//that is used to check what is being picked.
//
//case <PNAME>Action1:
// action = a;
// SetNeed([NEED_ELEMENT,NEED_ENTITY,NEED_RELATION]); OR....
// SetNeed(NEED_ELEMENT,Meta(some <PNAME> object class name)); OR...
// SetNeed(NEED_ELEMENT, some function that checks if the picked element is ok);
// break;
//
//Here we don't need anything. We can apply the action directly. E.g. writing out the graph, etc.
//
//case <PNAME>Action2:
//
//
//For example, if you want to iterate through the elements of the graph then use the VOUT macro.
//This iterates on the outgoing relations of the vgraph element. Setting elt to be the
//head of the relation.
//
//VRelation * r;
//VGraphElement * elt;
//VOUT(vgraph,r,VRelation,elt,VGraphElement)
//....
//ENDVOUT
//
//You can change the class types, VRelation, VGraphElement, if you want to
//limit your search to a particular type. e.g.
//SomeParticularRelType * r2;
//SomeParticularEltType * elt2;
//VOUT(vgraph,r2,SomeParticularRelType,elt2,SomeParticularEltType)
//...
//ENDVOUT
//break;
//
default: return <PNAME>View_BASE::SetAction2(a,data);
}
return TRUE;
}
//
//***IMPORTANT***
//This method gets called when the left mouse button is pushed
//Here you can check the current mode you set in SetAction2.
//
Command *<PNAME>View::DoLeftButtonDownCommand(Point p, Token t, int clicks){
//
//The clicks arg is the number of mouse clicks. This tends to be inexact
//and if there were more than 1 it could be anything. SO if you want to use
//it to catch a double click the check if clicks >1 not if clicks == 2
//
//
//You can check if the meta, cntl or shift keys have been pressed
//
bool meta = ((t.Flags & eFlgMetaKey) != 0);
bool cntl = ((t.Flags & eFlgCntlKey) != 0);
bool shift = ((t.Flags & eFlgShiftKey) != 0);
VGraphElement* pickedVGraphElement =0;
VEntity* pickedVEntity =0;
VRelation* pickedVRelation =0;
Gfx* pickedGfx =0;
//
//Here is an action include generated from the spec editor
//
#include "<PNAME>ActionDoLeft.h"
//
//The SetNeed(NEED_ELEMENT,NEED_ENTITY,RELATION ] ,...) method defines which of the variables,
//pickedVGraphElement,pickedVEntity, or pickedVRelation ,pickedGfx gets set.
//For example if SetNeed was called as SetNeed(NEED_ENTITY,Meta(SomeClassName)) then
//SatisfyNeeds will find the nearest entity of class, SomeClassName, and set pickedVEntity
// to it.
//
//
//Here is a way to turn on(off) the Gfx visibilty for a particular object
//if(action == SomeGfxVisibilityAction && pickedVGraphElement){
// Command * c = SatisfyNeeds(p, pickedVGraphElement,pickedVEntity, pickedVRelation ,pickedGfx);
// if(c != gNoChanges) return c;
// pickedVGraphElement->SetGfxVisibility(SomeGfxId,TRUE);
// return gNoChanges;
//}
//
//
//The following uses of command objects to popup windows are moot
//if (for et3.0.alpha) you put the fix in ET++ as mentioned
//in the ESCALANTE_DIR/README file.
//
//
//This is the way to show a dialog box and wait on its return.
// SomeDialog* dialog = new SomeDialog();
// int returnValue = dialog->ShowUnderMouse();
//
//
//To popup a new view you can do:
// gViewStack = stack; //the stack contains the vgraphs pushed by this view
// //setting gViewStack to the EscalanteView::stack lets the new view
// //inherit this views stack
// EscalanteDocument * newdoc = gEscalanteManager->NewEscalanteDocument(some visual graph element);
// gViewStack =0;
// if(newdoc) newdoc->Show();
return <PNAME>View_BASE::DoLeftButtonDownCommand(p, t, clicks);
}
//
//This is just like DoLeftButtonDowmCommand
//
Command *<PNAME>View::DoMiddleButtonDownCommand(Point p, Token t, int i){
//bool meta = ((t.Flags & eFlgMetaKey) != 0);
//bool cntl = ((t.Flags & eFlgCntlKey) != 0);
//bool shift = ((t.Flags & eFlgShiftKey) != 0);
VGraphElement * pickedVGraphElement =0;
VEntity* pickedVEntity =0;
VRelation* pickedVRelation =0;
Gfx * pickedGfx =0;
#include "<PNAME>ActionDoMiddle.h"
return <PNAME>View_BASE::DoMiddleButtonDownCommand(p, t, i);
}
//
//This method gets called after the pick rectangle has been drawn.
//The rectangle is the BaseEscalanteView attribute selectionRect
//
//void <PNAME>View::DoneDrawingRect(){
//<PNAME>View_BASE::DoneDrawingRect();
//}
//
//
//This method gets called after an element has been added.
//
//void <PNAME>View::DoneAddingElement(VGraphElement*e){
//<PNAME>View_BASE::DoneAddingElement(e);
//}
//
//
//This method gets called after a bunch off elements have been added.
//e.g. using multiple add
//
//void <PNAME>View::DoneAddingElements(class Set*s){}
//
//
//This method gets called after the position of an element has been moved
//
//void <PNAME>View::DoneMovingElement(VGraphElement*e){}
//
//
//This method gets called before an element is deleted.
//If return is FALSE then the delete does not occur
//
//bool <PNAME>View::OkToDeleteElement(VGraphElement*e){
//return <PNAME>View_BASE::OkToDeleteElement(e);
//}
//
//
//These methods are called when the View is drawn and when the graph
//is drawn.
//
//void <PNAME>View::Draw(Rectangle){}
//void <PNAME>View::DrawGraph(Rectangle r){}
//
//
//This methoid gets called when a new graph object has been picked
//(e.g. using Old View/New Graph). vg is the object that has been
//picked. Newvg is a parameter that is set to whatever new graph
//is desired. The default is newvg =vg;
//
//void <PNAME>View::GetNewGraph(VGraphElement * vg,VGraphElement * & newvg){}
//
//
//This gets called when a new graph has been picked. The base classes
//do things like calling GetNewGraph, MakeToolList, etc.
//For instance, look at the specification view GrandView::NewGraph.
//Here we do some of our own things. The BaseEscalanteView::type attribute
//is used to determine what type the view is. The GrandView sets its
//drawfunc accordingly and changes the name of its window.
//
//You can do whatever it is you want to do.
//
//void <PNAME>View::NewGraph(VGraphElement *, bool push = FALSE){}
//
//
//These methods get called when the head(or tail) of a relation cannot be found
//The Set,s, is the set of VGraphElements that may have been added along with
//the relation r (the relation is in the set s)
//If the return is eAbort then the adding of the relation is aborted
//without any of the elements just created being added to the graph.
//It is up to these methods to determine what to do with the relation (e.g. deleting).
//the elements in the set s.
//If the return is eAbortButSaveElements then the add is aborted but any elements in the
//set s are added to the graph
//If the return is eContinue then the process just continues.
//
//ErrorReturn <PNAME>View::CouldNotFindHead(VRelation*r,Set *s ){
//return <PNAME>View_BASE::CouldNotFindHead(r);
//}
//
//ErrorReturn <PNAME>View::CouldNotFindTail(VRelation*r,Set * s){
//return <PNAME>View_BASE::CouldNotFindTail(r);
//}
//
//
//This method gets called when some activity occurs in a VObject
//that is contained by this view. e.g picking an element in the palette
//
//void <PNAME>View::Control(int id, int part, void *val){
//<PNAME>View_BASE::Control(id,part,val);
//}
//
//
//This method gets called when some activity occurs in a VObject
//that the view creates. e.g. buttons, fields, etc.
//
//void <PNAME>Document::Control(int id, int part, void *val){
//<PNAME>Document_BASE::Control(id,part,val);
//}
//
//
// *** IMPORTANT ****
//
//This is where you define the initial system architecture.
//For each of the following vgraph[123] added to the list vgs
//(of course you can have any number of vgraphs and windows)
//there will be a window created. By letting the vgraphs
//share a common sg changes to one vgraph can be propagated
//to the others. E.g. Multiple views of a common structure.
//See the example application ESCALANTE_DIR/apps/MView.
//Of course you don't have to have an sg.
//
VGraphElement * gVGraph1 = 0;
VGraphElement * gVGraph2 = 0;
VGraphElement * gVGraph3 = 0;
void <PNAME>::MakeGraph(SGraphElement* & sg, ObjList* & vgs){
if(vgs == 0) vgs = new ObjList();
VGraphElement *ve;
SGraphElement *se;
VRelation * vr;
gVGraph1 = new VGraphElement(); gVGraph1->Init();
//gVGraph2 = new VGraphElement(); gVGraph2->Init();
//gVGraph3 = new VGraphElement(); gVGraph3->Init();
//
//You can set compile flags so that structural graph elements
//are not used. That is why we have the following #ifdef
//
#ifdef USE_STRUCTURAL
//sg = new SGraphElement(); sg->Init();
//sg->AddVGelt(gVGraph1);
//sg->AddVGelt(gVGraph2);
//sg->AddVGelt(gVGraph3);
//gVGraph1->SetSGelt(sg);
//gVGraph2->SetSGelt(sg);
//gVGraph3->SetSGelt(sg);
#endif
if(gVGraph1)
vgs->Add(gVGraph1);
if(gVGraph2)
vgs->Add(gVGraph2);
if(gVGraph3)
vgs->Add(gVGraph3);
//
//This is where you define the objects you want shown in the palette
//
//
//The following file gets generated automatically when you do a Make Everything in the
//specification editor. The default is that all visual constructs that were specified
//are included in this list. No structural elements are added here.
//
#include "<PNAME>MakeGraph.h"
//
//Use ADDV(...) when you do not want a structural element associated with the visual element
//This makes IO much quicker, there are less things to read and write
//
//ADDV(Some <PNAME> element class,gVGraph1);
//
//
//ADDSV(Some Structural entity class ,Some <PNAME> entity class,gVGraph1);
//ADDSV(Some structural relation class,Some <PNAME> relation, class,gVGraph1);
//
//
//Here you can add elements to gVGraph2. This will cause a second view window
//to open. If the structural types used here are the same as defined for gVGraph1
//things then when you add an element to gVGraph2 it is also added to gVGraph1
//(and vice versa)
//
//ADDSV(Some Structural entity class,Some <PNAME> entity,gVGraph2);
//ADDSV(SRelation,Some <PNAME> relation,gVGraph2);
//
//Here are some more flags you can set for the elements you are adding
//to the proto list
//
//If you don't want an element you just added to the protos list
//to show up in the palette then do:
//ve->ShowInPalette(FALSE);
//
//
//On adding an entity to a view the default is to just plop down the entity
//If you want a bunch of joints added or the point P2 to be set (e.g. sweeping out
//an area) then set the following flag.
//ve->NeedJoints(TRUE);
//
//
//If there are other vgraphelements associated with this element and we do not
//want to change the postiion of this element when the positions of all of the
//connected elements is changed (via meta key or All... methods then set this flag
//
//ve->AcceptPosChange(FALSE);
//
//When writing out this object is theimage also written out.
//Normally it isn't. IO seems to be quicker that way.
//Of course you can't save any state that has changes in the Gfx's
//So if you want the image to be saved for this element then set:
//
//ve->WriteGfx(TRUE);
//
//
//Are the joints that this element has relative to the point p1
//
//ve->RelJoints(TRUE);
//
//
//If this element is in a prototype list can it be used as a prototype
//when we get a NewElement from a connected SGraphElement.
//The default is TRUE
//
//ve->AcceptMapping(FALSE);
//
//
//While we are here there are also a bunch of virtual methods in VGraphElement
//that you can override that determine some of the behavior of the elements
//
//
//How small can the element be
//
//Point GetMinExtent(){return Point(20,20);}
//
//
//What is the name of the icon for this element
//
//char * GetIconName(){return 0;}
//
//When the element has been moved this method is called
//void MS_Moved(){}
//
//
//A hook for drawing
//
//virtual bool MS_Draw(Rectangle,void *){return TRUE;}
//
//
//And there are others. Just look in VGraphElement.h,VRelation.h,
//PVGraphElement.h and GraphObject.h
//
}
//
//These methods are called to make the manager,document and views of the appropriate
//type. A system is composed of one Manager, gEscalanteManager. That manager contains
//any number of Document objects. (one document for each window shown). Each Document
//has any number of Views (The default is one View per Documenet. However, you can
//set a flag in ETRC to show an observer view.)
//So we have something like this:
//
// gEscalanteManager
// / | ... \
// / | ... \
// Doc Doc ... Doc
// / \ | ... \
// View ...View View ... View
//
//
//You can have other types of documents in the system. Look at the PaletteDocument
//object in Escalante.[Ch].
//
//
//The default behavior is the following:
//The Application, <PNAME> creates a Manager of type <PNAME>Manager.
//The manager creates a document for each element in the vgraphs list created
//in <PNAME>::MakeGraph(). The Manager calls the virtual method MakeEscalanteDocument
//which by default returns a <PNAME>Document. This document calls the method MakeEscalanteView
//which by default returns a <PNAME>View.
//
EscalanteView * <PNAME>Document::MakeEscalanteView(int id,
Point p,
VGraphElement *vg){
return new <PNAME>View(id,this,p,vg);
}
EscalanteDocument * <PNAME>Manager::MakeEscalanteDocument(VGraphElement *vg){
return new <PNAME>Document(vg);
}
EscalanteManager * <PNAME>::MakeEscalanteManager(SGraphElement * sg,ObjList * vgs){
return new <PNAME>Manager(sg,vgs);
}
void <PNAME>Document::DoSetupMenu(Menu* m ){
register EscalanteView * dv;
Iter next(views);
int id = m->GetId();
if(id == e<PNAME>MENU || id == e<PNAME>HideMenu) {
while(dv = (EscalanteView*)next())
if( dv != gFirstHandler)
dv->DoSetupMenu(m);
}
else <PNAME>Document_BASE::DoSetupMenu(m);
}
//
//This is where the menus are initially created
//
MenuBar *<PNAME>Document::DoMakeMenuBar(){
MenuBar * mb;
//
//If you want to not have the default menus created in the base classes
//then don't call the parent class DoMakeMenuBar.
//Make your own menu bar and set up the menus as you want them
//
mb= <PNAME>Document_BASE::DoMakeMenuBar();
if(!mb) return 0;
Menu * m;
m = <PNAME>View::MakeMenu(e<PNAME>MENU);
if(m){
m->SetName("<PNAME>");
mb->AddMenu(m);
}
m = <PNAME>View::MakeMenu(e<PNAME>HideMenu);
if(m){
m->SetName("Hide/Show");
mb->AddMenu(m);
}
return mb;
}
<PNAME>View::<PNAME>View(int id,
class Document* doc,
Point pt,
VGraphElement*vg,
bool makePalette):<PNAME>View_BASE(id,doc,pt,vg,makePalette){
if(gDoGrid){
Multiples(TRUE);
DoGrid(TRUE);
}
}
Menu* <PNAME>View::MakeMenu(int menuid){
Menu *menu=0;
Menu * m;
switch(menuid){
case e<PNAME>MENU:
menu = new Menu(menuid,FALSE);
menu->SetName("<PNAME>");
if(gDoTimer)
menu->AppendItems(
"Step Clock",<PNAME>StepTimer,
"Toggle Clock@C",<PNAME>ToggleTimer, 0);
menu->AppendItems(
//
//Here is the include file generated by GrandView
//
#include "<PNAME>ActionMakeMenu.h"
0);
//
//This is how you can make a pull right menu
//
// m = MakeMenu(ePullRightMenu);
// if(m) menu->AppendMenu(m,ePullRightMenu);
break;
case e<PNAME>HideMenu:
menu = new Menu(menuid,FALSE);
menu->SetName("Hide/Show");
//
//This is the hide/show menu generated by GrandView
//
menu->AppendItems(
#include "<PNAME>HSList.h"
0);
break;
case ePullRightMenu:
menu = new Menu(menuid,FALSE);
menu->SetName("Pull right");
menu->AppendItems(
"Action 3" ,<PNAME>Action3,
0);
break;
default: return EscalanteView::MakeMenu(menuid);
}
return menu;
}
//
//DoSetupMenu gets called every time a menu is pulled down.
//This is where you enable the menu items and/or change what is
//displayed
//
void <PNAME>View::DoSetupMenu(Menu *menu){
Menu * omenu;
switch(menu->GetId()){
case ePullRightMenu:
menu->EnableItems(<PNAME>Action3,0);
break;
case e<PNAME>HideMenu:
#include "<PNAME>HSEnable.h"
break;
case e<PNAME>MENU:
//
//If there is a pull right menu defined in e<PNAME>MENU then do the following
//
if(omenu = (Menu*) menu->FindMenuItem(ePullRightMenu))
omenu->SetNextHandler(this);
//
//Here is an action include
//
#include "<PNAME>ActionEnableMenu.h"
//
//The following enables the items in e<PNAME>MENU
//
if(gDoTimer && g<PNAME>Timer){
menu->EnableItems(<PNAME>StepTimer, <PNAME>ToggleTimer,0);
menu->ReplaceItem(<PNAME>ToggleTimer,g<PNAME>Timer->active? "Clock Off@C":"Clock On@C");
}
break;
default: <PNAME>View_BASE::DoSetupMenu(menu);
}
}
//
//This method allows you to overwrite completely how the view is set up
//e.g. palette, canvas , topvobj, bottomvobj, etc.
//
//VObject * <PNAME>View::GetView(){
//return <PNAME>View_BASE::GetView();
//}
//
//
//This method allows you to return a VObject that will be displayed under the
//menu bar and over the canvas/palette. (where the Mode: and Error: fields is now.
//You can incorporate the Mode: and Error: fields. They are EscalanteView::info and EscalanteView::error
//
//VObject * <PNAME>View::GetTopVObj(){
//return <PNAME>View_BASE::GetTopVObj();
//}
//
//
//This method returns a vobject that is displayed under the palette/view area
//
//VObject * <PNAME>View::GetBottomVObj(){
//return <PNAME>View_BASE::GetBottomVObj();
//}
//
//
//These methods allow you to return a string that provides a description of
//this view, an element or an action.
//
//char * <PNAME>View::GetDescription(){
//return <PNAME>View_BASE::GetDescription();
//}
//
//char * <PNAME>View::GetElementDescription(VGraphElement*e){
//return <PNAME>View_BASE::GetElementDescription(e);
//}
//
//char * <PNAME>View::GetActionDescription(Actions a){
//return <PNAME>View_BASE::GetActionDescription(a);
//}
//
//
//These methods allow you to override how errors are signaled and cleared.
//
//void <PNAME>View::SignalError(char * c){
//<PNAME>View_BASE::SignalError(c);
//}
//
//void <PNAME>View::ClearError(){
//<PNAME>View_BASE::ClearError();
//}
//
//
//These methods allow you to override how modes are signaled and cleared.
//
//void <PNAME>View::SignalMode(char * c){
//<PNAME>View_BASE::SignalMode(c);
//}
//
//void <PNAME>View::ClearMode(){
//<PNAME>View_BASE::ClearMode();
//}
//
<PNAME>::<PNAME>(int argc, char* * argv):<PNAME>_BASE(argc,argv){
//
//If you want to set some global variables fronm the ETRC this is a good place
//to do it.
//E.g.
//SomeGlobalVariable = Env::GetValue("Some.Name.In.The.ETRC.File", some default value);
//
//
//This creates a new timer object. active = FALSE; rate = 0; (fastest)
//
if(gDoTimer)
g<PNAME>Timer= new <PNAME>Timer(FALSE,0);
//
//This creates a new grid object if needed
//
if(gDoGrid)
gGrid= new ObjectGrid(gGridSize);
}
main(int argc, char **argv){
//
//If you want to preload bitmap files for performance do:
//FindBitmap("some bitmap file name");
//This finds the bitmap and loads it into a global bitmap
//list. When a BitmapGfx object is created it looks at the list.
//This speeds up the process.
//
//You can define a color mapping using the gColorMap.
//This maps an integer to a color and is used in the Gfx attribute mapping
//e.g.
//gColorMap[1] = eRed;
//
//
//Likewise you can use a global text map that maps
//an integer to a text string
//e.g.
//gTextMap[1] = "Some text string";
//
gBorder = gPoint0;
DoGlobalInits();
<PNAME> theApplication(argc, argv);
return theApplication.Run();
}